clc; clear all; close all;

PSO_mean = csvread('PSO_mean.dat');
PSO_std = csvread('PSO_std.dat');

SGSA_mean = csvread('SGSA_mean.dat');
SGSA_std = csvread('SGSA_std.dat');

EGSA_mean = csvread('EGSA_mean.dat');
EGSA_std = csvread('EGSA_std.dat');

MGWO_mean = csvread('MGWO_mean.dat');
MGWO_std = csvread('MGWO_std.dat');

ABC_mean = csvread('ABC_mean.dat');
ABC_std = csvread('ABC_std.dat');

FCO_mean = csvread('FCO_mean.dat');
FCO_std = csvread('FCO_std.dat');


all_mean = [PSO_mean; SGSA_mean; EGSA_mean; MGWO_mean; ABC_mean; FCO_mean];
all_std = [PSO_std; SGSA_std; EGSA_std; MGWO_std; ABC_std; FCO_std];

rank = zeros(6,30);
% Type = ['PSO';'SGSA';'EGSA';'MGWO';'ABC';'FCO'];

for i = 1:30
    temp = [all_mean(:,i) (1:6)'];
    temp = sortrows(temp,1);
    rank(:,i) = temp(:,2);
end

PSO = sum(rank(1,:)==1)
SGSA = sum(rank(1,:)==2)
EGSA = sum(rank(1,:)==3)
MGWO = sum(rank(1,:)==4)
ABC = sum(rank(1,:)==5)
FCO = sum(rank(1,:)==6)


